module UsersHelper

  #返回用户头像的html url
  def userLogo(user)
    index =user.name.hash.abs % 12
    url =['http://img3.douban.com/icon/u69825251-4.jpg',
          'http://img3.douban.com/icon/u60819169-2.jpg',
          'http://img3.douban.com/icon/u4595890-27.jpg',
          'http://img3.douban.com/icon/u39467514-56.jpg',
          'http://img3.douban.com/icon/u3950606-3.jpg',
          'http://img3.douban.com/icon/u2076870-21.jpg',
          'http://img3.douban.com/icon/u73985962-18.jpg',
          'http://img3.douban.com/icon/u2860322-72.jpg',
          'http://img3.douban.com/icon/u1315928-7.jpg',
          'http://img3.douban.com/icon/u3001681-11.jpg',
          'http://img3.douban.com/icon/u63891671-7.jpg',
          'http://img3.douban.com/icon/u48028423-8.jpg',
          'http://img3.douban.com/icon/u47884118-18.jpg',
          'http://img3.douban.com/icon/u1258815-4.jpg',
          'http://img3.douban.com/icon/u64705566-4.jpg',
          'http://img3.douban.com/icon/u3572246-6.jpg'
    ]
    image_tag(url[index],alt: user.name, class: "userlogo")
  end


end
